/*
 * Copyright 2003-2005 (c) Live Media Pty Ltd. <argot@einet.com.au> 
 *
 * This software is licensed under the Argot Public License 
 * which may be found in the file LICENSE distributed 
 * with this software.
 *
 * More information about this license can be found at
 * http://www.einet.com.au/License
 * 
 * The Developer of this software is Live Media Pty Ltd,
 * PO Box 4591, Melbourne 3001, Australia.  The license is subject 
 * to the law of Victoria, Australia, and subject to exclusive 
 * jurisdiction of the Victorian courts.
 */

#include "TypeMeta.h"

#include "MetaName.h"

#include "../common/U8Ascii.h"

type_name meta_name_name = { "meta.name" };

int meta_name_read(type_input_stream * in, type_element * element)
{
	type_name * name = type_malloc( sizeof( type_name ));
	int rc = u8ascii_read( in, element );
	if ( rc != TYPE_OK ) return rc;
	
	name->name = type_stack_get_ptr( type_input_stack(in) );
	name->hash = 0;
	type_stack_set_ptr( type_input_stack(in), element, name );
	return TYPE_OK;
}


int meta_name_write(type_output_stream * out, void * o, type_element * element )
{
	type_name * name = (type_name *) o;
	return u8ascii_write( out, name->name, element );
}
